# 1.计算器
# num1 = float(input("输入你的第一个数："))
# num2 = float(input("输入你的第二个数："))
# sum_math = 0
# select_calculator = (input("请输入你的运算器：+，-，*，/\n"))
# if select_calculator == '+':
#     sum_math = num1 + num2
#     print(sum_math)
# elif select_calculator == '-':
#     sum_math = num1 - num2
#     print(sum_math)
# elif select_calculator == '*':
#     sum_math = num1 * num2
#     print(sum_math)
# elif select_calculator == '/':
#     if num2 == 0:
#         print("除数不能为0")
#     else:
#         sum_math = num1 / num2
#         print(sum_math)


# 2.猜数字
# from random import randint
#
# guess_sum = randint(0,100)
# for frequency in range(1,11):
#     number = input("请输入第"+str(frequency)+"次猜测的数字：")
#     if number.isdigit() is False:
#         print('请输入一个正确的数字')
#     elif int(number) < 0 or int (number) > 100:
#         print("请输入1-100范围的数字")
#     elif int(guess_sum) == int(number):
#         print("恭喜你用了%d次猜对了" % frequency)
#         break
#     elif int(guess_sum) > int(number):
#         print("很遗憾你猜小了")
#     elif int(guess_sum) < int(number):
#         print("很遗憾你猜大了")
#     if frequency == 10:
#         print("很遗憾，%d次机会已用尽，游戏结束，答案为%d" % (frequency,int(guess_sum)))


# # 3.逢7拍手游戏
# for i in range(1,101):
#     # 判断条件：既不包含7，也不是7的倍数
#     if "7" in str(i) or int(i) % 7 == 0:
#         # 输出，去掉了换行符
#         print('*', end="丶")
#         # 如果包含7 输出*
#     elif "7" not in str(i)and int(i) % 7 != 0:
#         print(i,end='丶')

# 4.if语句
# print('*'*10,'欢迎来到消消乐','*'*10)
# level = input('请输入你的级别(1v1,1v2):')
# if level == '1v1':
#     print("免费玩随便玩")
# else:
#     print("已经进入付费级别，充值继续玩")
#     money = int(input("请充值(必须是100的倍数）:"))
#     if money % 100 == 0 and money > 0:
#         print("充值成功！充值金额是：", money)
#     else:
#         print("充值失败，充值金额必须是100的倍数！")

# 5.continue的使用
# print('*'*30)
# name = '张无忌'
# for i in range(1,6):
#     if i == 3:
#         print("{}赶快扔掉这个馒头，有剧毒：'鹤顶红'!!!".format(name))
#         continue
#     print('{}很饿，正在吃第{}馒头'.format(name,i))

# 6.for...else语句
# name = '赵飞'
# num = int(input('请输入需要的馒头数量:'))
# for i in range(num):
#     print('{}很饿，正在吃第{}馒头'.format(name,i+1))
# else:
#     print('还没有吃饱馒头，{}饿哭啦......'.format(name))
# print('-------------')

# 7.用户登录
username = 'wlh'
password = '123456'
for i in range(3):
    input_username = str(input('请输入用户名：'))
    input_password = str(input('请输入密码：'))
    if input_username == username and input_password == password:
        print(('欢迎！用户{}'.format(username)))
        print('-'*5,'轻松购物吧','-'*5)
        break
    else:
        print('用户名或密码有误！')
else:
    print('用户被锁定，需要重新激活！')